import {createRouter, createWebHashHistory, createWebHistory, RouteRecordRaw} from 'vue-router'
import index from '../views/index.vue'
import component from "*.vue";

const routes: Array<RouteRecordRaw> = [
    {
        path: '/',
        name: 'index',
        component: index,
        redirect: '/system/user',
        children: [
            {path: 'system/user', component: () => import('../views/system/user/user.vue')},
            {path: 'system/home', component: () => import('../views/home/home.vue')},
            {path: 'system/setting', component: () => import('../views/system/setting/setting.vue')},
            {path: 'post/unit', component: () => import('../views/post/unit/unit.vue')},
            {path: 'post/order', component: () => import('../views/post/order/order.vue')},
            {path: 'post/template', component: () => import('../views/post/template/template.vue')},
            {path: 'post/delivery', component: () => import('../views/post/delivery/delivery.vue')},
            {path: 'post/invite', component: () => import('../views/post/invite/invite.vue')},
            {path: 'post/product', component: () => import('../views/post/product/product.vue')},

        ]
    },

    {
        path: '/login',
        component: () => import('../views/login/login.vue')
    },
]

const router = createRouter({
    history: createWebHashHistory(),
    routes
})

export default router
